package com.naiterui.ehp.bs.emr.vo.openapi.his;

import com.naiterui.ehp.bs.emr.utils.his.param.resp.PrescriptionItem;
import com.naiterui.ehp.bs.emr.utils.his.param.resp.PrescriptionResp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * 处方记录
 *
 * @author yiren
 * @since 2022/1/25
 */
@Data
@Builder
public class PrescriptionRecordVO {
	@ApiModelProperty(value = "处方编号")
	private String serialNumber;

	@ApiModelProperty(value = "临床诊断")
	private String diagnosis;

	@ApiModelProperty(value = "药品明细")
	private List<PrescriptionItem> items;

	public static PrescriptionRecordVO of(PrescriptionResp resp) {
		return PrescriptionRecordVO.builder()
				.serialNumber(resp.getSerialNumber())
				.diagnosis(resp.getDiagnosis())
				.items(resp.getItems())
				.build();
	}
}
